home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Graphics Programming (2nd Edition) / Visual Basic Graphics Programming 2nd Edition.iso / OldSrc / CH1 / SRC / FONTSHOW.FRM < prev    next >
Text File  |  1996-05-02  |  2KB  |  89 lines

  1. VERSION 4.00
  2. Begin VB.Form FontListForm 
  3.    Caption         =   "List Fonts"
  4.    ClientHeight    =   4260
  5.    ClientLeft      =   2115
  6.    ClientTop       =   1500
  7.    ClientWidth     =   4815
  8.    Height          =   4950
  9.    Left            =   2055
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   4260
  12.    ScaleWidth      =   4815
  13.    Top             =   870
  14.    Width           =   4935
  15.    Begin VB.ListBox ScreenList 
  16.       Height          =   3930
  17.       Left            =   120
  18.       Sorted          =   -1  'True
  19.       TabIndex        =   0
  20.       Top             =   120
  21.       Width           =   2175
  22.    End
  23.    Begin VB.Label DemoLabel 
  24.       BorderStyle     =   1  'Fixed Single
  25.       BeginProperty Font 
  26.          name            =   "MS Sans Serif"
  27.          charset         =   1
  28.          weight          =   400
  29.          size            =   12
  30.          underline       =   0   'False
  31.          italic          =   0   'False
  32.          strikethrough   =   0   'False
  33.       EndProperty
  34.       Height          =   3975
  35.       Left            =   2400
  36.       TabIndex        =   1
  37.       Top             =   120
  38.       Width           =   2295
  39.       WordWrap        =   -1  'True
  40.    End
  41.    Begin VB.Menu mnuFile 
  42.       Caption         =   "&File"
  43.       Begin VB.Menu mnuFileExit 
  44.          Caption         =   "E&xit"
  45.       End
  46.    End
  47. End
  48. Attribute VB_Name = "FontListForm"
  49. Attribute VB_Creatable = False
  50. Attribute VB_Exposed = False
  51. Option Explicit
  52.  
  53. Private Sub Form_Load()
  54. Dim i As Integer
  55.  
  56.     ' Fill the font list with font names.
  57.     For i = 0 To Screen.FontCount - 1
  58.         ScreenList.AddItem Screen.Fonts(i)
  59.     Next i
  60.     ScreenList.ListIndex = 0
  61.     ScreenList.Selected(0) = True
  62.  
  63.     ' Fill in the demo text.
  64.     DemoLabel.Caption = "ABCDE" & vbCrLf & _
  65.         "FGHIJ" & vbCrLf & "KLMNO" & vbCrLf & _
  66.         "PQRST" & vbCrLf & "UVWXYZ" & vbCrLf & _
  67.         "abcde" & vbCrLf & "fghij" & vbCrLf & _
  68.         "klmno" & vbCrLf & "pqrst" & vbCrLf & _
  69.         "uvwxyz" & vbCrLf & "12345" & vbCrLf & _
  70.         "67890"
  71. End Sub
  72.  
  73.  
  74. Private Sub Form_Unload(Cancel As Integer)
  75.     End
  76. End Sub
  77.  
  78.  
  79. Private Sub mnuFileExit_Click()
  80.     Unload Me
  81. End Sub
  82.  
  83.  
  84. Private Sub ScreenList_Click()
  85.     DemoLabel.Font.Name = ScreenList.List(ScreenList.ListIndex)
  86. End Sub
  87.  
  88.  
  89.